
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加联系人</title>
    <link rel="shortcut icon" href="easyui/css/images/favicon.ico" />
    <link rel="stylesheet" href="css/flipclock.css">
    <link href="css/CalcSS3.css" rel="stylesheet" type="text/css" />
    <link href="css/index.css" rel="stylesheet" type="text/css" />
    <link href="easyui/css/easyui.css" rel="stylesheet" type="text/css">
    <link href="easyui/css/easyui_animation.css" rel="stylesheet" type="text/css">
    <link href="easyui/css/easyui_plus.css" rel="stylesheet" type="text/css">
    <link href="easyui/css/insdep_theme_default.css" rel="stylesheet" type="text/css">
    <link href="easyui/css/icon.css" rel="stylesheet" type="text/css">
    <link href="easyui/css/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!-- 引入 ECharts 文件 -->
    <script src="js/echarts.js"></script>
    <!--放入自定义的图表-->
    <script src="js/monitor.js"></script>
    <script type="text/javascript" src="easyui/js/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/js/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="easyui/js/jquery.insdep-extend.min.js"></script>
</head>
<body>
<script>
    $(function () {
        $.extend($.fn.validatebox.defaults.rules, {    
		    textphone: {    
		        validator: function(value){ 
		        	var pattern = /^(13[0-9]|14[0-9]|15[0-9]|166|17[0-9]|18[0-9]|19[8|9])\d{8}$/;   
		        	return pattern.test(value);
		        },    
		        message: '手机号码格式不正确'   
		    } ,
		    texttel: {    
		        validator: function(value){ 
		        	 var pattern = /\d{3}-\d{8}|\d{4}-\{7,8}/; 
		        	 return pattern.test(value);
		        },    
		        message: '电话格式不正确'   
		    },
		    texturl: {    
		        validator: function(value){ 
		        	 var pattern = new RegExp("[a-zA-z]+://[^\s]*");
		        	 return pattern.test(value);
		        },    
		        message: '网址格式不正确'   
		    },
		    textemail:{
		    	validator: function(value){ 
		    		 var pattern = /^[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 
		        	 return pattern.test(value);
		        },    
		        message: '邮箱格式不正确'   
		    },
		    textqq:{
	    		validator: function(value){ 
	    		 var pattern = /[1-9][0-9]{4,}/; 
	        	 return pattern.test(value);
	        	},    
	        message: 'QQ格式不正确'   
	    	},
		    textname:{
	    		 validator: function(value){ 
	    		 var pattern = /^[\u4e00-\u9fa5_a-zA-Z]+/; 
	        	 return pattern.test(value);
	        	},    
	        message: '姓名格式不正确，必须是中文或者英文'   
	    	},
		    textwechat:{
	    		 validator: function(value){ 
	    		 var pattern = /^[a-zA-Z]{1}[-_a-zA-Z0-9]{5,19}$/; 
	        	 return pattern.test(value);
	        	},    
	        message: '微信格式不正确'   
	    	}
		});
        
        //选择客户刷新
        $('#care-form-client-combobox').combobox({
        	onChange:function(){
        		var value = $('#care-form-contact-combobox').combobox('getValue');
        		if(value == null || value ==""){
        			$('#care-form-contact-combobox').combobox({
        				url:'memorial-find-contact-id-name-by-cid',
        				method:'post',
        				queryParams : {
        					cid:$('#care-form-client-combobox').combobox('getValue')
        				}
        			})
        		}
        	}
        })
        
        $('#care-form-contact-combobox').combobox({
        	onChange:function(){
        		var clientValue = $('#care-form-client-combobox').combobox('getValue');
        		if(clientValue == null || clientValue ==""){
        			$('#care-form-client-combobox').combobox({
        				url:'memorial-find-clientInfo-by-contactid',
        				method:'post',
        				queryParams : {
        					contactid:$('#care-form-contact-combobox').combobox('getValue') == null?-1:$('#care-form-contact-combobox').combobox('getValue')
        				}
        			});
        		}
        	}
        });
        
    });
</script>
<div class="form-div">
    <form id="care-form" action="" method="post">
        <input type="hidden" name="careid" id="care-form-careid">
        <div class="dd">
       		<input id="care-form-careTheme" class="easyui-textbox" name="careTheme" data-options="label:'关怀主题：',required:true,width:650" /> 
        </div>
        
        <div class="dd">
       		<input id="care-form-client-combobox" class="easyui-combobox" name="cid" data-options="label:'对应客户：',required:true,width:650,
       			valueField:'cid',textField:'cname',url:'find-all-client'" /> 
        </div>
        
        <div class="dd">
        	<input name="clientId"  id="care-form-contact-combobox" class="easyui-combobox" name="contanctid " data-options="label:'联系人',required:true,width:320,
        		valueField:'contactid',textField:'contactName',url:'memorial-find-contact-id-name',method:'post'"> &nbsp;&nbsp;&nbsp;
			<input id="care-form-careDate" name="careDate" class="easyui-datebox" data-options="label:'日期：',width:320" >
        </div>
       
        <div class="dd">
			<input id="care-form-exertId" name="exertId" class="easyui-combobox" data-options="label:'执行人：',width:320,
			valueField:'uId',textField:'uname',url:'care-query-all-user'" >
        </div>
        
        <div class="dd">
            <input id="care-form-context" name="context"   class="easyui-textbox" data-options="label:'关怀内容：',width:320,height:100,
            multiline:true">&nbsp;&nbsp;&nbsp;
            <input id="care-form-feedback" name="feedback"   class="easyui-textbox" data-options="label:'客户反馈：',width:320,height:100,
            multiline:true">
        </div>
        
        
         <div class="dd">
            <input id="care-form-remarks" name="remarks"   class="easyui-textbox" data-options="label:'备注：',width:650,height:100,
            multiline:true">
        </div>
        
        
    </form>
</div>
</body>
</html>
